﻿<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>动态模板</title>
	<meta charset="utf-8" />
	<link href="../lib/highlight/default.css" rel="stylesheet" />
	<script src="../lib/jquery.js"></script>
	<script src="../lib/highlight.js"></script>
	<script src="../lib/jsm.js"></script>
	<script>hljs.initHighlightingOnLoad();</script>
</head>
<body>


	<h1>jsm：</h1>
	<script>
var output = jsm.div`动态模板：`();

for(var i = 0; i < 10; i++){
	if(i % 2 == 0){
		output.div({style:"background:yellow"})`第${i+1}行`()
	} else {
		output.div({})`第${i+1}行`()
	}
}

output.render();
	</script>

<pre><code class="javascript">
var output = jsm.div`动态模板：`();
for(var i = 0; i < 10; i++){
	if(i % 2 == 0){
		output.div({style:"background:yellow"})`第${i+1}行`()
	} else {
		output.div({})`第${i+1}行`()
	}
}
output.render();
</code></pre>



</body>
</html>
